#ifndef __GAMESLOT_H__
#define __GAMESLOT_H__

#include "GameGlobal.h"
#include <stdlib.h>

class MapSlot :public CCObject
{
private:
	bool					m_hasObject;
	int						m_row;
	int						m_column;

public:
	MapSlot(int row,int column):
	  m_hasObject(false),m_row(row),m_column(column){
	}

	static const int WIDTH = 80;
	static const int HEIGHT = 100;
	
	static string GetKey(int row,int column){
		string key ;
		key.push_back('R');
		key.push_back(row + 0x30);
		key.push_back('C');
		key.push_back(column + 0x30);
		return key;
	}

	static MapSlot* Create(int row,int column);

	bool CheckOverlap(CCRect* rect);
	bool CheckOverlap(CCPoint* rect);

	string GetKey(){
		return GetKey(m_row,m_column);
	}

	int Row() { return m_row;}
	int Column() {return m_column;}

	void Set() { m_hasObject = true; }
	void Unset(){m_hasObject = false; }
};

#endif